package map;

import java.util.Hashtable;

public class HashtableMain {
	
	public static void main(String[] args) {
		
		Hashtable h = new Hashtable();
		
		h.put("Name", "홍길동");
		h.put("Age", new Integer(27));
		h.put("Tel", "02-1111-2222");
		h.put("Handphone", "017-777-9999");
		h.put("Etc", "I'm a boy.");
		
		// 키 값으로 데이터를 조회
		String name = (String) h.get("Name");
		Integer age = (Integer) h.get("Age");
		
		System.out.println("name: " + name +
				", age: " + age);
		
		h.put(new Integer(1), "일");
		
		String i = (String) h.get(new Integer(1));
		
		System.out.println("Integer(1) 값: " + i);
	}
	
}
